package textdiff {
	import mx.controls.Text;
	

	/**
	 * Can be used to transform Old into New.
	 * Concrete classes fill in the command name and old and new lines affected as
	 * appropriate.
	 */
	public class EditCommand {
	    public var command: String = "undefined";
	    public var oldLines:LineBlock = null;
	    public var newLines:LineBlock = null;
	
	    public function EditCommand(oldFileInfo:FileInfo=null, newFileInfo:FileInfo=null) {
	    }
	    
	    public function toXML():XML {
	    	var result:XML = <command id={command}></command>;
	    	if (newLines != null) {
	    		result.appendChild(newLines.toXML());
	    	}
	    	return result;
	    }
	    
	    public function toEditScript(): String {
	    	return "";
	    }
	    
		/**
		 * Applies this EditCommand to the specified text t starting at the specified offset.
		 * It operates on a copy of the original text and will return the modified copy as the result of the operation.
		 * 
		 * The offset comes from the result of a previously executed EditCommand that may have inserted or deleted 
		 * some lines before the original start position of this EditCommand that would make that start position invalid.
		 * 
		 * @param t - an Array of strings each representing a single line
		 * @param offset - the (optional) offset within t to start the operation at
		 * @returns a new Array of strings containing the result of the operation 
		 */
	    public function editText(t:Array, offset:int=0): Array {
	    	return t;
	    }
	    
	    public function get fromLineNum(): int { return -1; }
	    public function get thruLineNum(): int { return -1; }
	}
}